import glob

import yagmail,logging,HTMLTestRunner_PY3

class Tools():
    def log_set(self):
        log = logging.basicConfig(filename='log.log',
                                  filemode='a+',
                                  format='%(message)s',
                                  level=logging.DEBUG)
        return log
    def report(self):
        report = HTMLTestRunner_PY3.HTMLTestRunner(open('my.html','wb'),
                                                   title='jenkins',
                                                   description='PO')
        return report

    def sendemail(self):
        file = glob.glob('*.log')+glob.glob('*.html')
        email = yagmail.SMTP(user='3315608326@qq.com',password='hjvhfyfvztaxchei',host='smtp.qq.com')
        email.send(to='3315608326@qq.com',subject='ddd', attachments=file)
        email.close()


